<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class AboutYou::SDK::Criteria::ProductFields - RDoc Documentation</title>

<link href="../../../fonts.css" rel="stylesheet">
<link href="../../../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../../";
</script>

<script src="../../../js/jquery.js"></script>
<script src="../../../js/navigation.js"></script>
<script src="../../../js/search_index.js"></script>
<script src="../../../js/search.js"></script>
<script src="../../../js/searcher.js"></script>
<script src="../../../js/darkfish.js"></script>


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../../../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../../../table_of_contents.html#pages">Pages</a>
    <a href="../../../table_of_contents.html#classes">Classes</a>
    <a href="../../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    <div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  
  <p class="link">Object
  
</div>

    
    
    <!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    
    <li ><a href="#method-c-filter_fields">::filter_fields</a>
    
    <li ><a href="#method-c-requires_categories">::requires_categories</a>
    
    <li ><a href="#method-c-requires_facets">::requires_facets</a>
    
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-AboutYou::SDK::Criteria::ProductFields">
  <h1 id="class-AboutYou::SDK::Criteria::ProductFields" class="class">
    class AboutYou::SDK::Criteria::ProductFields
  </h1>

  <section class="description">
    
<p>This class is used for the selection of certain product fields which should
be fetched in addition when making an api call</p>
<dl class="rdoc-list note-list"><dt>author
<dd>
<p>Collins GmbH &amp; Co KG</p>
</dd></dl>

  </section>

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    
    <section class="constants-list">
      <header>
        <h3>Constants</h3>
      </header>
      <dl>
      
        <dt id="ATTRIBUTES_MERGED">ATTRIBUTES_MERGED
        
        <dd><p>product field “attributes_merged”</p>
        
      
        <dt id="BRAND">BRAND
        
        <dd><p>product field “brand_id”</p>
        
      
        <dt id="CATEGORIES">CATEGORIES
        
        <dd><p>product field “categories”</p>
        
      
        <dt id="DEFAULT_IMAGE">DEFAULT_IMAGE
        
        <dd><p>product field “default_image”</p>
        
      
        <dt id="DEFAULT_VARIANT">DEFAULT_VARIANT
        
        <dd><p>product field “default_variant”</p>
        
      
        <dt id="DESCRIPTION_LONG">DESCRIPTION_LONG
        
        <dd><p>product field “description_long”</p>
        
      
        <dt id="DESCRIPTION_SHORT">DESCRIPTION_SHORT
        
        <dd><p>product field “description_short”</p>
        
      
        <dt id="INACTIVE_VARIANTS">INACTIVE_VARIANTS
        
        <dd><p>product field “inactive_variants”</p>
        
      
        <dt id="IS_ACTIVE">IS_ACTIVE
        
        <dd><p>id and name is set per default product field “is_active”</p>
        
      
        <dt id="IS_SALE">IS_SALE
        
        <dd><p>product field “sale”</p>
        
      
        <dt id="MAX_PRICE">MAX_PRICE
        
        <dd><p>product field “max_price”</p>
        
      
        <dt id="MAX_SAVINGS">MAX_SAVINGS
        
        <dd><p>product field “max_savings”</p>
        
      
        <dt id="MAX_SAVINGS_PERCENTAGE">MAX_SAVINGS_PERCENTAGE
        
        <dd><p>product field “max_savings_percentage”</p>
        
      
        <dt id="MIN_PRICE">MIN_PRICE
        
        <dd><p>product field “min_price”</p>
        
      
        <dt id="TAGS">TAGS
        
        <dd><p>product field “tags”</p>
        
      
        <dt id="VARIANTS">VARIANTS
        
        <dd><p>product field “variants”</p>
        
      
      </dl>
    </section>
    

    

    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Class Methods</h3>
       </header>

    
      <div id="method-c-filter_fields" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_fields</span><span
            class="method-args">(fields)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>filters a given set of fields</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>fields</code> -&gt; an Array of product fields which should be
filtered</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a filtered Array of product fields</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_fields-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_fields.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">filter_fields</span>(<span class="ruby-identifier">fields</span>)
  <span class="ruby-identifier">fields</span> = <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">uniq</span>

  <span class="ruby-comment"># this simplifies parsing on (pre)fetching facets</span>
  <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">push</span>(<span class="ruby-constant">ATTRIBUTES_MERGED</span>) <span class="ruby-keyword">if</span>
  <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">ATTRIBUTES_MERGED</span>) <span class="ruby-operator">&amp;&amp;</span>
  (<span class="ruby-identifier">fields</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">BRAND</span>)  <span class="ruby-operator">||</span>
  <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">VARIANTS</span>) <span class="ruby-operator">||</span>
  <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">DEFAULT_VARIANT</span>))

  <span class="ruby-identifier">fields</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-c-requires_categories" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">requires_categories</span><span
            class="method-args">(fields)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>determines whether the api call has to require Categories or not</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>fields</code> -&gt; an Array of product fields which should be
filtered</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a boolean which is true when ap call has to require categories</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="requires_categories-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_fields.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">requires_categories</span>(<span class="ruby-identifier">fields</span>)
  <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">CATEGORIES</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-c-requires_facets" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">requires_facets</span><span
            class="method-args">(fields)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>determines whether the api call has to require Facets or not</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>fields</code> -&gt; an Array of product fields which should be
filtered</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a boolean which is true when ap call has to require facets</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="requires_facets-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_fields.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">requires_facets</span>(<span class="ruby-identifier">fields</span>)
  ([<span class="ruby-constant">BRAND</span>,
    <span class="ruby-constant">VARIANTS</span>,
    <span class="ruby-constant">DEFAULT_VARIANT</span>,
    <span class="ruby-constant">ATTRIBUTES_MERGED</span>
   ] <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">fields</span>).<span class="ruby-identifier">count</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

